Skip to content

Conversation

@blckmn
Copy link
Member

@blckmn blckmn commented Nov 9, 2025

Setting to 1... instead of ON

Support for betaflight/betaflight#14738

Summary by CodeRabbit

  • Configuration
    • Enabled yaw motor reversal for NBD_INFINITYF4, TRANSTECF405HD, TRANSTECF411AIO, and TRANSTECF411HD flight controller boards.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 9, 2025

Walkthrough

This change enables yaw motor reversal across four drone flight controller configurations (NBD_INFINITYF4, TRANSTECF405HD, TRANSTECF411AIO, TRANSTECF411HD) by activating the YAW_MOTORS_REVERSED macro, replacing previously commented placeholder directives with active definitions set to value 1.

Changes

Cohort / File(s) Summary
Yaw motors reversal activation
configs/NBD_INFINITYF4/config.h, configs/TRANSTECF405HD/config.h, configs/TRANSTECF411AIO/config.h, configs/TRANSTECF411HD/config.h
Replaced commented TODO placeholder //TODO #define YAW_MOTORS_REVERSED ON with active macro definition #define YAW_MOTORS_REVERSED 1

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Simple, repetitive macro activation across homogeneous configuration files with identical change pattern

Suggested reviewers

  • Quick-Flash
  • ot0tot
  • nerdCopter

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is incomplete and does not follow the required template, which mandates checklist items, hardware compliance details, and mandatory review documentation for flight controller configurations. Complete the PR description using the template structure, including the mandatory checklist items, hardware compliance statements, and details about the configuration changes being made.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Adding YAW_MOTORS_REVERSED' clearly and specifically describes the main change: enabling the YAW_MOTORS_REVERSED macro across four configuration files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch yaw_motors_reversed

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3507b7 and 3ff0efc.

📒 Files selected for processing (4)
  • configs/NBD_INFINITYF4/config.h (1 hunks)
  • configs/TRANSTECF405HD/config.h (1 hunks)
  • configs/TRANSTECF411AIO/config.h (1 hunks)
  • configs/TRANSTECF411HD/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-03T15:17:30.040Z
Learning: In Betaflight configurations, when a target name suggests dual IMUs (like JHEF7DUAL) but specific hardware variants only have one gyro available, the preferred solution is to use DEFAULT_GYRO_TO_USE macro to specify which gyro to use by default rather than pruning gyro defines or creating redundant configurations. This approach maintains compatibility when the same target is used by multiple hardware variants from the same manufacturer.
Learnt from: haslinghuis
Repo: betaflight/config PR: 822
File: configs/AXISFLYINGH7MINI/config.h:29-37
Timestamp: 2025-06-23T18:43:31.746Z
Learning: In Betaflight configuration files, feature enablement macros like USE_MAG are build options that can be controlled at compile time, while hardware instance definitions like MAG_I2C_INSTANCE are predefined in board configurations to assist with hardware mapping when those features are enabled at build time.
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/BEEROTORF4/config.h:30-30
Timestamp: 2025-05-28T15:42:05.402Z
Learning: The DEFAULT_GYRO_ENABLED macro with both gyros enabled (GYRO_MASK(0) | GYRO_MASK(1)) should only be added to board configurations that have DEFAULT_GYRO_TO_USE set to GYRO_CONFIG_USE_GYRO_BOTH. Boards without this setting should only get the GYRO_COUNT definition to specify the number of available gyros.
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/FLYWOOF411/config.h:33-33
Timestamp: 2025-05-28T15:48:18.449Z
Learning: The FLYWOOF411 board does not actually use dual gyros despite having GYRO_2_SPI_INSTANCE defined in its configuration. It was incorrectly targeted for GYRO_COUNT and dual gyro support.
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/BEEROTORF4/config.h:30-30
Timestamp: 2025-05-28T15:42:05.402Z
Learning: The DEFAULT_GYRO_ENABLED macro with both gyros enabled (GYRO_MASK(0) | GYRO_MASK(1)) should only be added to board configurations that have DEFAULT_GYRO_TO_USE set to GYRO_CONFIG_USE_GYRO_BOTH. Boards without this setting should only get the GYRO_COUNT definition.
Learnt from: haslinghuis
Repo: betaflight/config PR: 656
File: configs/IFLIGHT_F745_AIO/config.h:31-35
Timestamp: 2025-07-28T16:44:59.686Z
Learning: In Betaflight board configurations, when a board design uses the same physical gyro socket but different sensor variants across production batches (e.g., MPU6000 in older batches, ICM42688P in newer batches), the correct approach is to enable both sensor drivers (USE_GYRO_SPI_MPU6000 and USE_GYRO_SPI_ICM42688P) in the same configuration. This allows runtime auto-detection of which sensor is actually present without requiring separate board configurations for each hardware variant.
Learnt from: haslinghuis
Repo: betaflight/config PR: 835
File: configs/HDZERO_HALO_MPU6000/config.h:29-35
Timestamp: 2025-07-14T16:16:50.628Z
Learning: CW0_DEG is not a universal default gyro alignment setting in Betaflight configurations. Different boards use different gyro alignments (CW0_DEG, CW90_DEG, CW180_DEG, CW270_DEG, CW0_DEG_FLIP, etc.) based on their physical sensor mounting orientation.
Learnt from: haslinghuis
Repo: betaflight/config PR: 757
File: configs/HAKRCH743/config.h:134-134
Timestamp: 2025-08-05T16:56:44.200Z
Learning: In Betaflight board configurations, when DEFAULT_GYRO_TO_USE is set to GYRO_CONFIG_USE_GYRO_BOTH, the firmware automatically establishes GYRO_COUNT during initialization for backwards compatibility. Therefore, explicit GYRO_COUNT definitions are not needed in board config files when using DEFAULT_GYRO_TO_USE.
Learnt from: ot0tot
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the BOARD_NAME define in each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.
📚 Learning: 2025-05-28T15:42:05.402Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/BEEROTORF4/config.h:30-30
Timestamp: 2025-05-28T15:42:05.402Z
Learning: The DEFAULT_GYRO_ENABLED macro with both gyros enabled (GYRO_MASK(0) | GYRO_MASK(1)) should only be added to board configurations that have DEFAULT_GYRO_TO_USE set to GYRO_CONFIG_USE_GYRO_BOTH. Boards without this setting should only get the GYRO_COUNT definition.

Applied to files:

  • configs/TRANSTECF405HD/config.h
  • configs/TRANSTECF411AIO/config.h
  • configs/TRANSTECF411HD/config.h
📚 Learning: 2025-05-28T15:42:05.402Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/BEEROTORF4/config.h:30-30
Timestamp: 2025-05-28T15:42:05.402Z
Learning: The DEFAULT_GYRO_ENABLED macro with both gyros enabled (GYRO_MASK(0) | GYRO_MASK(1)) should only be added to board configurations that have DEFAULT_GYRO_TO_USE set to GYRO_CONFIG_USE_GYRO_BOTH. Boards without this setting should only get the GYRO_COUNT definition to specify the number of available gyros.

Applied to files:

  • configs/TRANSTECF405HD/config.h
  • configs/TRANSTECF411AIO/config.h
  • configs/TRANSTECF411HD/config.h
📚 Learning: 2025-08-22T17:08:23.283Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 879
File: configs/AIRBOTSUPERF4V2/config.h:42-45
Timestamp: 2025-08-22T17:08:23.283Z
Learning: In Betaflight board configurations, OSD feature flags like USE_OSD_SD (analog/MAX7456) and USE_OSD_HD (digital/MSP DisplayPort) are typically defined at build time by the build system, not in the individual board config.h files. Board configs can conditionally define OSD-related settings based on these build-time flags.

Applied to files:

  • configs/TRANSTECF405HD/config.h
  • configs/TRANSTECF411AIO/config.h
  • configs/NBD_INFINITYF4/config.h
📚 Learning: 2025-07-03T15:17:30.040Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-03T15:17:30.040Z
Learning: In Betaflight configurations, when a target name suggests dual IMUs (like JHEF7DUAL) but specific hardware variants only have one gyro available, the preferred solution is to use DEFAULT_GYRO_TO_USE macro to specify which gyro to use by default rather than pruning gyro defines or creating redundant configurations. This approach maintains compatibility when the same target is used by multiple hardware variants from the same manufacturer.

Applied to files:

  • configs/TRANSTECF405HD/config.h
  • configs/TRANSTECF411AIO/config.h
  • configs/TRANSTECF411HD/config.h
📚 Learning: 2025-08-05T16:56:44.200Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 757
File: configs/HAKRCH743/config.h:134-134
Timestamp: 2025-08-05T16:56:44.200Z
Learning: In Betaflight board configurations, when DEFAULT_GYRO_TO_USE is set to GYRO_CONFIG_USE_GYRO_BOTH, the firmware automatically establishes GYRO_COUNT during initialization for backwards compatibility. Therefore, explicit GYRO_COUNT definitions are not needed in board config files when using DEFAULT_GYRO_TO_USE.

Applied to files:

  • configs/TRANSTECF405HD/config.h
📚 Learning: 2025-07-14T16:16:50.628Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 835
File: configs/HDZERO_HALO_MPU6000/config.h:29-35
Timestamp: 2025-07-14T16:16:50.628Z
Learning: GYRO_1_SPI_CLOCK_DIVIDER is not used in any Betaflight target configuration files. SPI clock frequency settings are not commonly configured at the target level.

Applied to files:

  • configs/TRANSTECF405HD/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines (like ESC_SENSOR_UART, MSP_UART, GPS_UART, etc.) use valid SERIAL_PORT identifiers that match those defined in the Betaflight codebase at src/main/io/serial.h. Common valid identifiers include SERIAL_PORT_USART1, SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, etc. Invalid identifiers like SERIAL_PORT_UART3 (should be SERIAL_PORT_USART3) will cause build failures.

Applied to files:

  • configs/TRANSTECF405HD/config.h
  • configs/TRANSTECF411AIO/config.h
  • configs/NBD_INFINITYF4/config.h
📚 Learning: 2025-06-23T18:44:59.162Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 822
File: configs/AXISFLYINGH7MINI/config.h:121-129
Timestamp: 2025-06-23T18:44:59.162Z
Learning: In Betaflight configuration files, USE_OSD_HD and USE_MAX7456 are for different OSD systems: USE_MAX7456 enables the MAX7456 analog OSD chip, while USE_OSD_HD enables HD/digital OSD via MSP. MSP_DISPLAYPORT_UART should be guarded by USE_OSD_HD, not USE_MAX7456, as they serve different OSD implementations.

Applied to files:

  • configs/TRANSTECF405HD/config.h
  • configs/TRANSTECF411AIO/config.h
📚 Learning: 2025-07-14T16:16:50.628Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 835
File: configs/HDZERO_HALO_MPU6000/config.h:29-35
Timestamp: 2025-07-14T16:16:50.628Z
Learning: CW0_DEG is not a universal default gyro alignment setting in Betaflight configurations. Different boards use different gyro alignments (CW0_DEG, CW90_DEG, CW180_DEG, CW270_DEG, CW0_DEG_FLIP, etc.) based on their physical sensor mounting orientation.

Applied to files:

  • configs/TRANSTECF405HD/config.h
🔇 Additional comments (4)
configs/NBD_INFINITYF4/config.h (1)

94-94: LGTM!

The macro definition is correct and consistent with the other board configurations in this PR.

configs/TRANSTECF411HD/config.h (1)

77-77: LGTM!

The macro definition is correct and consistent with the other board configurations in this PR.

configs/TRANSTECF405HD/config.h (1)

80-80: LGTM!

The macro definition is correct and consistent with the other board configurations in this PR.

configs/TRANSTECF411AIO/config.h (1)

88-88: I need to search for more specific implementation details about how the YAW_MOTORS_REVERSED macro is defined and used in PR #14738, as the initial result doesn't clarify the expected value format.

I need to search more specifically for the actual implementation details of PR #14738 to understand what value format the macro expects.

Let me search more directly for the PR #14738 pull request page:

Verify compatibility between the config.h macro definition and PR #14738's implementation.

The review comment asks to verify whether PR #14738 expects numeric values (1) or symbolic constants (ON) for YAW_MOTORS_REVERSED. Based on available information, runtime settings in Betaflight configurations use symbolic constants like ON, while compile-time macros in config.h files conventionally use numeric values (1/0) to represent boolean states. The macro definition #define YAW_MOTORS_REVERSED 1 follows standard C preprocessor practice for boolean compile-time constants. However, without access to the specific implementation details of PR #14738's macro usage in mixer_init.c, the exact compatibility cannot be definitively confirmed through public sources.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

#define DEFAULT_CURRENT_METER_SCALE 245
#define BEEPER_PWM_HZ 1000
//TODO #define YAW_MOTORS_REVERSED ON
#define YAW_MOTORS_REVERSED 1
Copy link
Member

@haslinghuis haslinghuis Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest simplifying like INVERTED

BEEPER_INVERTED
BUTTON_A_PIN_INVERTED
BUTTON_B_PIN_INVERTED
LEDx_INVERTED
SDCARD_DETECT_INVERTED
RX_SPI_LED_INVERTED

Suggested change
#define YAW_MOTORS_REVERSED 1
#define YAW_MOTORS_REVERSED

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different use cases. Your suggested similarities are all pins. This changes mixer behaviour.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, IMO there is no need for #define YAW_MOTORS_REVERSED OFF (or 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants